import odoo from '@/odoo'


export default {
  namespace: 'login',

  state: {
    user: {},
  },

  effects: {
    *login({ payload }, { call, put }) {
        const sid = yield odoo.login(payload)
        console.log(sid)
        console.log(odoo.user)
      yield put({
        type: 'save',
        payload: {user:odoo.user },
      });

    },

    *logout(_, { put }) {
    },
  },

  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
